s{extend name="layout/detail" /}
{block name="content"}
<input id="ajax" value="1" type="hidden">
<div class="layui-tab td-tab-1 no-margin">
    <ul class="layui-tab-title">
        <li class="layui-this" onclick="order();">订单收款账户</li>
        <li onclick="security()">保证金收款账户</li>
    </ul>
</div>
<div class="td-content-wrap p20">
    <div class="space-20"></div>
    <form id="form_data" class="layui-form" method="post">
        <input type="hidden" name="data_type" value="order">
        <div class="layui-form-item">
            <label class="layui-form-label">收款账户名称：</label>
            <div class="layui-input-block w40">
                <input type="text" class="layui-input" id="zhifubao_app_id" name="company" check="required"
                       info="app_id"
                       value="{$system_data.company|default=''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">开户银行：</label>
            <div class="layui-input-block">
                <textarea class="layui-textarea" id="zhifubao_merchant_private_key" name="bank">{$system_data.bank|default=''}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">银行账号：</label>
            <div class="layui-input-block">
                <textarea class="layui-textarea" id="zhifubao_alipay_public_key" name="account">{$system_data.account|default=''}</textarea>
            </div>
        </div>
        <hr>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-block">
                <a class="layui-btn" lay-submit="" lay-filter="demo2" onclick="save();">保存</a>
                <a class="layui-btn layui-btn-primary" onclick="go_return_url();">取消</a>
            </div>
        </div>
    </form>
</div>
{/block}

{block name="script"}
<script>
    layui.use(['element'], function () {
        set_return_url(null);
        var fn = {
            order: function () {
                window.open('{:url("SystemConfig/order")}', '_self');
            },
            security: function () {
                window.open('{:url("SystemConfig/security")}', '_self');
            },
            save: function () {
                send_form("form_data", "{:url('save')}",  function (res) {
                    if (res.code) {
                        layer.msg(res.msg, {
                            time: 1200
                        }, function () {
                            location.reload(true);
                        });
                    } else {
                        layer.msg(res.msg);
                        return false;
                    }
                });
            }
        };
        win_exp(fn);
    });
</script>
{/block}